<?php include_once "top.php";?>
<div class="addleft">
	<a href="excel.php">导出EXCEL</a>
</div>
<div class="addbar">
	<ul>
	<h2>导出EXCEL</h2>
	<li align="center">
		<label><strong>总体数据：</strong></label>
		<label><input type="button" name="" value="导出" onclick="location.href='excel2.php?t=1'" /></label>
		<label style="margin-left:25px"><strong>门店详细：</strong></label>
		<label><input type="button" name="" value="导出" onclick="location.href='excel2.php?t=3'" /></label>
		<label style="margin-left:25px"><strong>意见箱：</strong></label>
		<label><input type="button" name="" value="导出" onclick="location.href='excel2.php?t=7'" /></label>
	</li>
	<li align="center">
		<form action="excel2.php" method="get" onsubmit="return checkForm(2)">
		<input type="hidden" name="t" value="2" />
		<label><strong>兑换记录：</strong></label>
		<label style="width:auto">
			<input id="sdate2" type="text" name="sdate" value="" class="laydate-icon ipt" placeholder="选择开始日期" onclick="laydate()" style="width:150px" />
			<select id="stime2" name="stime" class="ipt" style="width:auto;height:24px">
				<?php for($i=0;$i<=23;$i++){?>
				<option value="<?php echo $i<10?('0'.$i):($i)?>:00:00"><?php echo $i<10?('0'.$i):($i)?>:00</option>
				<?php }?>
			</select>
		</label>
		<label style="width:auto;margin-left:15px"> - </label>
		<label style="width:auto">
			<input id="edate2" type="text" name="edate" value="" class="laydate-icon ipt" placeholder="选择结束日期" onclick="laydate()" style="width:150px;margin-left:15px" />
			<select id="etime2" name="etime" class="ipt" style="width:auto;height:24px">
				<?php for($i=0;$i<=23;$i++){?>
				<option value="<?php echo $i<10?('0'.$i):($i)?>:00:00"><?php echo $i<10?('0'.$i):($i)?>:00</option>
				<?php }?>
			</select>
		</label>
		<label><input type="submit" name="" value="导出" /></label>
		</form>
	</li>
	<li align="center">
		<form action="excel2.php" method="get" onsubmit="return checkForm(4)">
		<input type="hidden" name="t" value="4" />
		<label><strong>销售记录：</strong></label>
		<label style="width:auto">
			<input id="sdate4" type="text" name="sdate" value="" class="laydate-icon ipt" placeholder="选择开始日期" onclick="laydate()" style="width:150px" />
			<select id="stime4" name="stime" class="ipt" style="width:auto;height:24px">
				<?php for($i=0;$i<=23;$i++){?>
				<option value="<?php echo $i<10?('0'.$i):($i)?>:00:00"><?php echo $i<10?('0'.$i):($i)?>:00</option>
				<?php }?>
			</select>
		</label>
		<label style="width:auto;margin-left:15px"> - </label>
		<label style="width:auto">
			<input id="edate4" type="text" name="edate" value="" class="laydate-icon ipt" placeholder="选择结束日期" onclick="laydate()" style="width:150px;margin-left:15px" />
			<select id="etime4" name="etime" class="ipt" style="width:auto;height:24px">
				<?php for($i=0;$i<=23;$i++){?>
				<option value="<?php echo $i<10?('0'.$i):($i)?>:00:00"><?php echo $i<10?('0'.$i):($i)?>:00</option>
				<?php }?>
			</select>
		</label>
		<label><input type="submit" name="" value="导出" /></label>
		</form>
	</li>
	<li align="center">
		<form action="excel2.php" method="get" onsubmit="return checkForm(6)">
		<input type="hidden" name="t" value="6" />
		<label><strong>答题数据：</strong></label>
		<label style="width:auto">
			<input id="sdate6" type="text" name="sdate" value="" class="laydate-icon ipt" placeholder="选择开始日期" onclick="laydate()" style="width:150px" />
			<select id="stime6" name="stime" class="ipt" style="width:auto;height:24px">
				<?php for($i=0;$i<=23;$i++){?>
				<option value="<?php echo $i<10?('0'.$i):($i)?>:00:00"><?php echo $i<10?('0'.$i):($i)?>:00</option>
				<?php }?>
			</select>
		</label>
		<label style="width:auto;margin-left:15px"> - </label>
		<label style="width:auto">
			<input id="edate6" type="text" name="edate" value="" class="laydate-icon ipt" placeholder="选择结束日期" onclick="laydate()" style="width:150px;margin-left:15px" />
			<select id="etime6" name="etime" class="ipt" style="width:auto;height:24px">
				<?php for($i=0;$i<=23;$i++){?>
				<option value="<?php echo $i<10?('0'.$i):($i)?>:00:00"><?php echo $i<10?('0'.$i):($i)?>:00</option>
				<?php }?>
			</select>
		</label>
		<label><input type="submit" name="" value="导出" /></label>
		</form>
	</li>
	<li align="center">
		<form action="excel2.php" method="get" onsubmit="return checkForm(5)">
		<input type="hidden" name="t" value="5" />
		<label><strong>心愿单数据：</strong></label>
		<label style="width:auto">
			<input id="sdate5" type="text" name="sdate" value="" class="laydate-icon ipt" placeholder="选择开始日期" onclick="laydate()" style="width:150px" />
			<select id="stime5" name="stime" class="ipt" style="width:auto;height:24px">
				<?php for($i=0;$i<=23;$i++){?>
				<option value="<?php echo $i<10?('0'.$i):($i)?>:00:00"><?php echo $i<10?('0'.$i):($i)?>:00</option>
				<?php }?>
			</select>
		</label>
		<label style="width:auto;margin-left:15px"> - </label>
		<label style="width:auto">
			<input id="edate5" type="text" name="edate" value="" class="laydate-icon ipt" placeholder="选择结束日期" onclick="laydate()" style="width:150px;margin-left:15px" />
			<select id="etime5" name="etime" class="ipt" style="width:auto;height:24px">
				<?php for($i=0;$i<=23;$i++){?>
				<option value="<?php echo $i<10?('0'.$i):($i)?>:00:00"><?php echo $i<10?('0'.$i):($i)?>:00</option>
				<?php }?>
			</select>
		</label>
		<label><input type="submit" name="" value="导出" /></label>
		</form>
	</li>
	<li align="center">
		<form action="excel2.php" method="get" onsubmit="return checkForm(8)">
		<input type="hidden" name="t" value="8" />
		<label><strong>城市销量排名：</strong></label>
		<label style="width:auto">
			<input id="sdate8" type="text" name="sdate" value="" class="laydate-icon ipt" placeholder="选择开始日期" onclick="laydate()" style="width:150px" />
			<select id="stime8" name="stime" class="ipt" style="width:auto;height:24px">
				<?php for($i=0;$i<=23;$i++){?>
				<option value="<?php echo $i<10?('0'.$i):($i)?>:00:00"><?php echo $i<10?('0'.$i):($i)?>:00</option>
				<?php }?>
			</select>
		</label>
		<label style="width:auto;margin-left:15px"> - </label>
		<label style="width:auto">
			<input id="edate8" type="text" name="edate" value="" class="laydate-icon ipt" placeholder="选择结束日期" onclick="laydate()" style="width:150px;margin-left:15px" />
			<select id="etime8" name="etime" class="ipt" style="width:auto;height:24px">
				<?php for($i=0;$i<=23;$i++){?>
				<option value="<?php echo $i<10?('0'.$i):($i)?>:00:00"><?php echo $i<10?('0'.$i):($i)?>:00</option>
				<?php }?>
			</select>
		</label>
		<label><input type="submit" name="" value="导出" /></label>
		</form>
	</li>
	<li align="center">
		<form action="excel2.php" method="get" onsubmit="return checkForm(9)">
		<input type="hidden" name="t" value="9" />
		<label><strong>店铺销量排名：</strong></label>
		<label style="width:auto">
			<input id="sdate9" type="text" name="sdate" value="" class="laydate-icon ipt" placeholder="选择开始日期" onclick="laydate()" style="width:150px" />
			<select id="stime9" name="stime" class="ipt" style="width:auto;height:24px">
				<?php for($i=0;$i<=23;$i++){?>
				<option value="<?php echo $i<10?('0'.$i):($i)?>:00:00"><?php echo $i<10?('0'.$i):($i)?>:00</option>
				<?php }?>
			</select>
		</label>
		<label style="width:auto;margin-left:15px"> - </label>
		<label style="width:auto">
			<input id="edate9" type="text" name="edate" value="" class="laydate-icon ipt" placeholder="选择结束日期" onclick="laydate()" style="width:150px;margin-left:15px" />
			<select id="etime9" name="etime" class="ipt" style="width:auto;height:24px">
				<?php for($i=0;$i<=23;$i++){?>
				<option value="<?php echo $i<10?('0'.$i):($i)?>:00:00"><?php echo $i<10?('0'.$i):($i)?>:00</option>
				<?php }?>
			</select>
		</label>
		<label><input type="submit" name="" value="导出" /></label>
		</form>
	</li>
	<!--<form action="excel2.php" method="get" onsubmit="return checkForm(11)">-->
	<li align="center" style="border:none">
		<input type="hidden" name="t" value="11" />
		<label><strong>产品销量：</strong></label>
		<label style="width:auto">
			<input id="sdate11" type="text" name="sdate" value="" class="laydate-icon ipt" placeholder="选择开始日期" onclick="laydate()" style="width:150px" />
			<select id="stime11" name="stime" class="ipt" style="width:auto;height:24px">
				<?php for($i=0;$i<=23;$i++){?>
				<option value="<?php echo $i<10?('0'.$i):($i)?>:00:00"><?php echo $i<10?('0'.$i):($i)?>:00</option>
				<?php }?>
			</select>
		</label>
		<label style="width:auto;margin-left:15px"> - </label>
		<label style="width:auto">
			<input id="edate11" type="text" name="edate" value="" class="laydate-icon ipt" placeholder="选择结束日期" onclick="laydate()" style="width:150px;margin-left:15px" />
			<select id="etime11" name="etime" class="ipt" style="width:auto;height:24px">
				<?php for($i=0;$i<=23;$i++){?>
				<option value="<?php echo $i<10?('0'.$i):($i)?>:00:00"><?php echo $i<10?('0'.$i):($i)?>:00</option>
				<?php }?>
			</select>
		</label>
	</li>
	<li align="center">
		<label><strong>&nbsp;</strong></label>
		<label style="width:auto">
			<select id="pro_id" name="pro_id" class="ipt" style="width:460px;height:24px">
				<?php foreach($db->ig2_select('mae_pro','1 order by id desc') as $list){?>
				<option value="<?php echo $list['pro_id']?>"><?php echo trim($list['pro_name_cn'])?$list['pro_name_cn']:'(空白)无产品信息'?></option>
				<?php }?>
			</select>
		</label>
		<label><input id="sel" type="button" name="" value="查看" onclick="selCount()" /></label>
	</li>
	<!--</form>-->
	</ul>
</div>
<script>
//删除左右两端的空白字符
function trim(str){
	return str.replace(/(^\s*)|(\s*$)/g, "");
}

function checkForm(t){
	var sdate=trim($('#sdate'+t).val());
	var edate=trim($('#edate'+t).val());
	if(sdate==''){
		alert('请选择开始日期');
		return false;
	}
	if(edate==''){
		alert('请选择结束日期');
		return false;
	}
	return true;
}

function selCount(){
	if(checkForm(11)){
		var sdate=$('#sdate11').val();
		var edate=$('#edate11').val();
		var stime=$('#stime11').val();
		var etime=$('#etime11').val();
		var pro_id=$('#pro_id').val();
		
		$.ajax({
			type: "GET",
			url: "ra_ajax.php?selCount=1&sdate="+sdate+"&edate="+edate+"&stime="+stime+"&etime="+etime+"&pro_id="+pro_id,
			success: function(data){
				alert(data);
			}
		});
	}
}
</script>
<?php include_once "down.php";?>